from core.support import set_cutscene
from core.item import Item
from core.action import Action
from core.player import Player

class Flamingfifty(Item):
    def __init__(self):
        Item.__init__(self, "fiftyshadesonfire")    # do basic initialization for every item
        # build list of actions
        self.add_action(usefiftyshadesonfire)
        self.inuse = False
    
    def get_description(self):
        return "Book on fire"

# define actions for this item

class usefiftyshadesonfire(Action):
    def __init__(self):
        Action.__init__(self, "usefiftyshadesonfire")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Use book on fire"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "post"
    
    # only works in basement. add cutscene
    def do_action(self,game,room,request):
        if room.get_id() == 'sea8hearhello': 
            game.player.inventory['fiftyshadesonfire'].inuse = True
            set_cutscene("Burn Baby Burn.  Wave it to get their attention.")
        else:
            self.item.inuse = False
            set_cutscene("What am I going to use this book on fire for?")
        return